﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DevMy.Vou
{
    public partial class Form_Car2 : Form_BaseDialog
    {
        public Form_Car2()
        {
            InitializeComponent();
            this.Text = "参数计算";
        }
        public void Ini()
        {
            base.SetComponent();
        }
        /// <summary>
        /// 窗体状态
        /// </summary>
        /// <param name="WinType">-1：查看，0：修改，1：增加</param>
        public void SetWinType(int WinType)
        {
            base.WinType = WinType;
        }

        protected override void DisplayComponent(string id)
        {
            base.class_RadioGroup.SetRadioGroup(this.radioGroup1, null, 2);
            //if (id != null)
            //{
            //    this.spinEdit1.ReadOnly = true;
            //    string Sql = string.Format("Select * From vou_equipment Where id ='{0}'", id);
            //    DataTable dataTable = base.class_MySqlDataBase.GetDataTable(Sql);
            //    if (dataTable != null && dataTable.Rows.Count == 1)
            //    {
            //        DataRow dataRow = dataTable.Rows[0];
            //        if (dataRow != null)
            //        {
            //            this.spinEdit1.Value = int.Parse(dataRow["id"].ToString());
            //            this.textEdit1.Text = dataRow["equipmentName"].ToString();
            //            this.textEdit2.Text = dataRow["factoryName"].ToString();
            //            this.textEdit3.Text = dataRow["ip"].ToString();
            //            //this.textEdit4.Text = dataRow["id"].ToString();
            //            this.memoEdit1.Text = dataRow["remark"].ToString();
            //            this.comboBoxEdit1.Text = dataRow["equipmentType"].ToString();
            //            this.spinEdit2.Value = int.Parse(dataRow["port"].ToString());
            //            this.spinEdit3.Value = int.Parse(dataRow["sensorCount"].ToString());
            //        }
            //    }
            //}
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}
